package com.xbongbong.paas.service;

import com.xbongbong.paas.pojo.dto.PaasFormDataEsInitByCorpidListAndBusinessTypeListDTO;
import com.xbongbong.paas.pojo.dto.PaasFormDataEsInitDTO;
import com.xbongbong.paas.pojo.dto.PaasFormDataEsMappingDTO;
import com.xbongbong.paas.pojo.dto.PaasFormOriginalDataInitDTO;
import com.xbongbong.paas.pojo.dto.SwitchRefreshDTO;
import com.xbongbong.paas.pojo.vo.PaasFormDataEsInitVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.parent.es.PaasElasticSearchInitInterface;

/**
 * ES相关数据操作
 * 创建时间： 2018/9/27 16:08
 * 修改时间： 2018/9/27 16:08 梁鲁江
 *
 * @author 梁鲁江
 */
public interface PaasElasticSearchService  extends PaasElasticSearchInitInterface {

    PaasFormDataEsInitVO initAll(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

    /**
     * 团队成员需求同步paas子表单数据
     *
     * @param paasFormDataEsInitDTO
     * @return
     * @throws Exception
     */
    PaasFormDataEsInitVO initPaasSubData(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws Exception;

    /**
     * 高版本索引初始化
     * @param paasFormDataEsMappingDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsInitVO initHighMapping(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;
    PaasFormDataEsInitVO initMappingAll(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;
    BaseVO deleteMapping(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;


    /**
     * 图表中心
     * @param paasFormDataEsMappingDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsInitVO initHighMappingTest(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;
    /**
     *   初始化索引   SAAS 表单的特殊处理
     * @param paasFormDataEsMappingDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsInitVO initSaasMapping(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;

    /**
     * 初始化数据   SAAS 表单的特殊处理
     * @param paasFormDataEsInitDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsInitVO initSaasData(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;
    /**
     * 删除所有的数据
     * @param paasFormDataEsInitDTO
     * @return
     * @throws XbbException
     */
    @Deprecated
    PaasFormDataEsInitVO  deleteAllData(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;
    
    PaasFormDataEsInitVO initByCorpidListAndBusinessTypeList(PaasFormDataEsInitByCorpidListAndBusinessTypeListDTO paasFormDataEsInitByCorpidListAndBusinessTypeListDTO);
    /**
     * 添加索引
     * @param paasFormDataEsMappingDTO
     * @return
     * @throws XbbException
     */
    PaasFormDataEsInitVO addAlias(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;

    PaasFormDataEsInitVO addAllAlias(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;

    /**
     * Description:初始化自定义子表单数据（只对数据库数据进行子表单数据拆分，不同步es，同时不删除主表内的子表单数据，主表的子表单数据通过sql去处理）
     * @param paasFormOriginalDataInitDTO
     * @return com.xbongbong.paas.pojo.vo.PaasFormDataEsInitVO
     * @throws XbbException 异常
     * @author 魏荣杰
     * @date 2020/9/28 15:02
     * @since
     */
    PaasFormDataEsInitVO initOriginData(PaasFormOriginalDataInitDTO paasFormOriginalDataInitDTO) throws XbbException;



    /**
     * paas团队成员同步，主要指的是paas协同人
     *
     * @param paasFormDataEsInitDTO
     * @return
     */
    PaasFormDataEsInitVO paasTeamDataInit(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

    /**
     * 团队成员需求用于paas表单提前刷数据
     *
     * @param paasFormDataEsInitDTO
     * @return
     */
    PaasFormDataEsInitVO teamMembersPaasFormDataInit(PaasFormDataEsInitDTO paasFormDataEsInitDTO) throws XbbException;

    /**
     * 删除paas的es索引，只用于团队成员需求，后续此脚本不能再使用
     *
     * @param paasFormDataEsMappingDTO
     * @return
     */
    BaseVO deletePaasMapping(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO);

    /**
     * 获取paas表单数据，用于团队功能进行比较数据
     *
     * @param paasFormDataEsMappingDTO
     * @return
     */
    String checkEsDataNum(PaasFormDataEsMappingDTO paasFormDataEsMappingDTO) throws XbbException;
}
